using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Modules_DVPJSC_wucDVPChangeLang : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string str = "";
            string lang = "";
            if (Request.QueryString["Page"] != null)
            {
                str = Request.QueryString["Page"].ToString();
                if (Request.QueryString["lang"] != null)
                    if (str == "home" && Request.QueryString["lang"].ToString() == "Vi")
                    {
                        Session["LanguageCode"] = "vi-VN";
                        redirecturl();
                    }
            }
        }
    }
    protected void vnicon_Click(object sender, ImageClickEventArgs e)
    {

        Session["LanguageCode"] = "vi-VN";
        redirecturl();

    }
    protected void enicon_Click(object sender, ImageClickEventArgs e)
    {
        Session["LanguageCode"] = "en-EN";
        redirecturl();
    }
    protected void redirecturl()
    {
        string str = "";
        if (Request.QueryString["Page"] != null)
        {
            str = Request.QueryString["Page"].ToString();
        }
        switch (str)
        {
            case "home":
                Response.Redirect("~/Default.aspx?page=home");
                break;
            case "StandardDetail":
                Response.Redirect("~/Default.aspx?page=Standard");
                break;
            case "PartnersDetail":
                Response.Redirect("~/Default.aspx?page=Partners");
                break;
            case "NewsDetail":
                Response.Redirect("~/Default.aspx?page=NewsList&CateId=24");
                break;
            case "ProductDetail":
                Response.Redirect("~/Default.aspx?page=productlist");
                break;

            default: Response.Redirect(Request.RawUrl);
                break;
        }
    }
}
